package xin.ganbo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import xin.ganbo.vo.UserListRespVO;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author ganbo E-mail:bo.gan@56qq.com
 * @since 2017-11-07 20:18
 */
@Controller
public class UserController extends BaseController{

    @GetMapping(value = "/user/user_list_page")
    public String userListPage(){
        System.out.println("用户列表============");
        return "/user/user_list";
    }

    @GetMapping(value = "/user/user_list")
    @ResponseBody
    public Object userList(Integer limit, Integer offset){

        List<UserListRespVO> list = new ArrayList<>();
        list.add(new UserListRespVO("1","aaa","男"));
        list.add(new UserListRespVO("2","bbb","男"));
        list.add(new UserListRespVO("3","ccc","男"));
        list.add(new UserListRespVO("4","ddd","男"));
        list.add(new UserListRespVO("5","eee","男"));
        list.add(new UserListRespVO("6","fff","男"));
        list.add(new UserListRespVO("7","ggg","男"));

        Map<String,Object> result = new HashMap<>();
        result.put("total",list.size());
        result.put("rows",list);
        return result;
    }


}
